package cn.lixu.org.domain;

import cn.lixu.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
public class Department extends BaseDomain {

    private String sn;
    private String name;
    //上级部门路径
    private String dirPath;
    //状态
    private Integer state;
    //部门领导id
    private Long manager_id;

    //Employee对象 领导manager
    private Employee manager;

    //上级部门id
    private Long parent_id;

    private Department parent;
    //子集部门
    //用于封装当前部门的子部门
    //部门树最后一级没有数据就不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    List<Department> children = new ArrayList<>();
}

